<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>MUSE Player Demo</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <link href="https://fonts.googleapis.com/css?family=Pacifico" rel="stylesheet">
  <style type="text/css">
    html, body {
      width: 100%;
      height: 100%;
      margin: 0px;

      font-family: 'STHeiti', '微软雅黑', '文泉驿微米黑';
    }

    a {
      color: rgb(52,189,207);
    }

    .github {
      position: absolute;
      top: 10px;
      right: 10px;
    }

    .change-layout-container {
      padding: 20px 0px;
      text-align: center;
    }

    #header {
      width: 100%;
      height: 64px;
      line-height: 64px;

      position: relative;

      color: #fff;
      background: #2196f3;
      box-shadow: 0.06rem 0.06rem 0.1rem rgba(0,0,0,.2), -0.06rem 0 0.06rem rgba(0,0,0,.1);
    }

    #header h1 {
      height: 100%;
      text-overflow: ellipsis;
      overflow: hidden;
      text-align: center;
      margin: 0px;
      font-size: 30px;
      font-family: 'Pacifico';
    }

    #app {
      display: flex;
      justify-content: center;

      margin: 20px;
    }

    #footer {
      margin-top: 20px;
      font-size: 14px;
      text-align: center;
    }

    @media screen and (max-width: 640px) {
      .github { display: none;  }
    }
  </style>
</head>
<body>
  <div id="container">
    <div id="header">
      <h1>MUSE: Just a simple and dilligent HTML5 Player</h1>
      <a class="github" href="https://github.com/moefront/muse">
        <img src="" />
      </a>
    </div>

    <div id="app">(・ω・) Rendering Player...</div>
    <div class="change-layout-container">
      <button id="change-layout-btn">
        Change player layout to <span id="layout-item">landscape</span>
      </button>
    </div>

    <div id="footer">
      &copy;2017 | Built with ❤ by <a href="https://github.com/moefront/">MoeFront Studio</a> | MIT License
    </div>
  </div>

  <script>__REACT_DEVTOOLS_GLOBAL_HOOK__ = parent.__REACT_DEVTOOLS_GLOBAL_HOOK__</script>
  <script type="text/javascript" src="/assets/muse-player.js"></script>
  <script>
    if (window.MUSE == undefined) {
      document.write("<script src=\"assets/muse-player.js\"><\/script>");
    }
  </script>
  <script src="example.js"></script>

  <script type="text/javascript">
    // change layout bind
    var currentLayout = 'default', nextLayout = 'landscape';
    document.getElementById('change-layout-btn').addEventListener('click', function() {
      if (!window.MUSE) {
        console.log('Please wait while MUSE is rendering...');
      }

      if (currentLayout == 'default') {
        currentLayout = 'landscape', nextLayout = 'default';
      } else if (currentLayout == 'landscape') {
        currentLayout = 'default', nextLayout = 'landscape';
      }
      MUSE.changePlayerLayout(player.id, 'muse-layout-' + currentLayout);
      document.getElementById('layout-item').innerHTML = nextLayout;
    });
  </script>
</body>
</html>
